//①引入
import Vue from 'vue'
import VueRouter from 'vue-router'
//组件
import HomeVue from '@/views/HomeVue.vue'
import ClassIfy from '@/views/ClassIfy.vue'
import Order from '@/views/Order.vue'
import MyVue from '@/views/MyVue.vue'
//② 调用Vue.use() 去注册这个插件
Vue.use(VueRouter)
    //③ 创建路由实例
const router = new VueRouter({
        routes: [{
                path: '/',
                redirect: '/home',
            },
            {
                path: '/home',
                component: HomeVue,
            },
            {
                path: '/class',
                component: ClassIfy,
            },
            {
                path: '/order',
                component: Order,
            },
            {
                path: '/myvue',
                component: MyVue,
            }
        ]
    })
    //对外暴露路由实例
export default router